#ifndef GROUPDIALOG_H
#define GROUPDIALOG_H
#include <QMap>
#include <QMapIterator>
#include <QDialog>
//#include "mainwindow.h"
#include"dbutil.h"
using namespace std;
namespace Ui
{
class GroupDialog;
}

class GroupDialog : public QDialog
{
    Q_OBJECT

public:
    GroupDialog(QWidget *parent = 0);
    //GroupDialog(QWidget *parent = 0, MainWindow1 *mw = 0);
    ~GroupDialog();
    void initDevices(QMap<int, QString> deviceids);
    void initGroups(QMap<int, QString> groups);
    int groupId;
    int mainDeviceid;
    void init();
private slots:
    void on_pushButton_4_clicked();

    void on_pushButton_3_clicked();

    void on_addDevice_clicked();

    void on_addGroup_clicked();
private:
    //MainWindow1 *mw;
    Ui::GroupDialog *ui;
    QMap<int, QString> deviceids;
    QMap<int, QString> groupids;
    bool isContain(QMap<int, QString> ids, int id);
    QString groupName;
};

#endif // GROUPDIALOG_H
